#!/usr/bin/perl 
# to run this script, open Terminal and run: perl [location to this script]

%CONVERSION_PATTERNS = 
(
  'www.newsisfree.com/HPE/xml'        => 'xml.newsisfree.com',
);

# process the SlashDockConfig.plist file
open(JPIPE, 'find ~/Library/Preferences/ -name "SlashDock.config.plist" -print |');
@configfiles = <JPIPE>;
close(JPIPE);

foreach $file (@configfiles) {
print $file;
  chomp $file;
  open(FILE, $file);
  @lines = <FILE>;
  close(FILE);
  foreach $line (@lines) {
    my $sstr, $rstr;
    while (($sstr,$rstr)=each(%CONVERSION_PATTERNS)) {
      $line =~ s/$sstr/$rstr/g;
    }
  }
  close(FILE);
  open(FILE, ">$file");
  print FILE @lines;
  close(FILE);
}
